<script lang="ts">
import ReconnectingWebSocket from 'reconnecting-websocket';
var timeLabel =""
var socket = new ReconnectingWebSocket("wss://"+window.location.hostname+"/backend/ws/timeservice");

// Connection opened
socket.addEventListener("open", function (event) {
  console.log("It's open");
});

// Listen for messages
socket.addEventListener("message", function (event) {
  console.log(event.data);
  timeLabel =event.data
});
</script>

<main>
    <h1>{timeLabel}</h1>

</main>

<style lang="scss">
	main {
		margin: 0 auto;
	}
</style>
